package com.gitee.wsl.mathematics.geometry.d3.polygon

import com.gitee.wsl.mathematics.geometry.d3.edge.Edge
import com.gitee.wsl.mathematics.geometry.d3.face.Face
import com.gitee.wsl.mathematics.geometry.d3.vertex.Vertex

fun <T> Map<Edge, T>.directedEdgeToFaceVertexMap(): Map<Face, Map<Vertex, T>> =
    entries
        .groupBy{ it.key.r }
        .mapValues { e ->
            e.value.associateBy({ it.key.a }, { it.value })
        }